package com.lz.fruitday.utils;



import android.content.Context;

import com.lz.fruitday.BaseApp;

import java.io.File;

/**
 * Created by Administrator on 2015/10/9.
 */
public class FileUtil {
    /**
     * 得到app的根目录
     */
    public static String getRootCache() {
        File externalCacheDir = BaseApp.getInstance().getExternalCacheDir();
        if (!externalCacheDir.exists()) {
            externalCacheDir.mkdirs();
        }
        return externalCacheDir.getAbsolutePath();
    }
    /**
     * 得到图片的保存路径
     *
     * @return
     */
    public static File getImageCache() {
        String imageCache = getRootCache() + AppConfig.IMAGE_CACHE;
        File file=new File(imageCache);
        if (!file.exists()){
            file.mkdir();
        }
        return file;
    }


}
